package com.cz.video.website.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.cz.video.common.core.domain.BaseEntity;
import com.cz.video.common.core.validate.AddGroup;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 电影视频表
 * </p>
 *
 * @author 洪圆胜
 * @since 2023-10-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("website_video")
@Schema(description="电影视频表")
public class WebsiteVideo extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @TableId(value = "video_id")
    private Long videoId;

    @Schema(description = "封面")
    private String images;

    @Schema(description = "标题")
    @NotBlank(message = "没有填写视频的标题",groups = AddGroup.class)
    private String title;

    @Schema(description = "类型")
    private String type;

    @Schema(description = "视频id")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String vid;

    @Schema(description = "上传者id")
    private Long uploaderId;

    @Schema(description = "描述")
    private String description;

    @Schema(description = "发布时间")
    private Date publishTime;

    @Schema(description = "审核状态")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String auditState;

    @Schema(description = "审核结果")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String auditResult;

    @Schema(description = "上传状态")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String uploadStatus;

    @Schema(description = "状态（0发布 1停用）")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String status;

    @Schema(description = "删除标志（0代表存在 1代表删除）")
    @TableLogic
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String delFlag;

    @Schema(description = "备注")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String remark;

    @Schema(description = "阅读数")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer clickCount;

    @Schema(description = "评论数")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer commentCount;

    @Schema(description = "收藏数")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer collectionCount;

    @Schema(description = "支持数")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer supportCount;

    @Version
    @Schema(description = "版本号")
    private Integer version;

    @Schema(description = "分类id")
    private Integer categoryId;

    @Schema(description = "视频总长度")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer totalVideoLength;

    @Schema(description = "文件大小")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long fileSize;

    @Schema(description = "视频url")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String fileUrl;

}
